package com.ybfenpan.controller.admin.info;


import com.ybfenpan.controller.core.BaseController;
import com.ybfenpan.model.Admin;
import com.ybfenpan.model.Notice;
import com.ybfenpan.model.log.LogMoneyTi;
import com.ybfenpan.service.NoticeService;
import com.ybfenpan.service.log.LogMoneyTiService;
import com.ybfenpan.utils.ContextUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;


/**
 * Created by Administrator on 2016/3/25.
 */
@Controller
 
public class WelcomeController extends BaseController {
    @Resource
    private NoticeService noticeService;

    @Resource
    private LogMoneyTiService logMoneyTiService;
   
    @RequestMapping("admin/info/welcome.shtml")
    public String add(ModelMap model, HttpServletRequest request, HttpServletResponse response) {
    	
		//新增
    	Admin admin = ContextUtil.getAdmin();
    	Map formMap = getParameterMap(request);
    	
    	formMap.put("where", " 1=1 order by commitDate desc limit 0,5");

    	List<Notice> noticeList = noticeService.queryForList("select", formMap);
		request.setAttribute("noticeList",noticeList);

        formMap.put("where", " 1=1 and a.state = 10 order by a.id desc ");
        List<LogMoneyTi>  logTiList= logMoneyTiService.queryForList("logMoneyTiForPage", formMap);
        request.setAttribute("logMoneyTiList",logTiList);
		 
        return "admin/info/welcome";
        
		
     
    }
  
}
